/**
* Copyright (C) 2007 Pedro Miller Rabinovitch.
* http://www.opensource.org/licenses/mit-license.php
*
* Basically, feel free to use it however you want to.
* Please give me credit where appropriate.
*
* Pedro "Shade" Miller, gmail user: pedromr
* http://exodia.org
*
* @author Miller
*
* $Id: WorldShape.as 8 2007-12-13 10:26:42Z pedromr $
*/
package org.exodia.seeds.sprites {
	
	import flash.display.Graphics;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;
	import org.exodia.seeds.model.World;
	import org.exodia.seeds.sprites.AgentShape;
	import org.exodia.seeds.model.Agent;

	public class WorldShape extends Sprite {
		private var _world:World;
		private var _arrAgentShapes:Array;
		
		public function WorldShape( world:World ) {
			_world = world;
			_arrAgentShapes = new Array();
			
			drawBorders();
		}

		private function drawBorders() : void {
			var g:Graphics = graphics;
			g.clear();
			g.lineStyle( 1, 0x000000 );
			g.beginFill( 0xF8F8F8 );
			g.drawRect( 0, 0, _world.width, _world.height );
			g.endFill();
		}
		
		public function addAgentShape( shape:AgentShape ):void {
			_arrAgentShapes.push( shape );
			_world.addAgent( shape.agent );
			addChild(shape);
		}
	}
	
}
